# 自定义函数
def count_len(data):
    """
    计算字符串长度

    :param data:字符串
    :return:长度
    """
    count = 0
    for _ in data:
        count += 1
    # print(f"{data}的长度是：{count}")
    return count


# count_len("hello world")
# count_len("hello ")

count = count_len("hello world")
print(count)

num = 10
# 10
print(num)


def test():
    global num
    num = 20
    # 20
    print(num)


test()
# 20
print(num)
